package com.example.controller;

import com.example.common.Result;
import com.example.model.OperationLedger;
import com.example.service.OperationLedgerService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/data")
public class OperationLedgerController {
    @Resource
    public OperationLedgerService operationLedgerService;
    @PostMapping("/insertOperationLedger")
    public Result insertOperationLedger(@RequestBody OperationLedger operationLedger) {

        int count = operationLedgerService.insertOperationLedger(operationLedger);
        if(count > 0) {
            return Result.ok("新增记录成功。。。");
        }
        return Result.error("新增记录失败。。。");
    }
}
